<%@page pageEncoding = "utf-8" contentType = "text/html;charset=utf-8"%>

<%@taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix = "fmt" uri = "http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix = "fn" uri = "http://java.sun.com/jsp/jstl/functions"%>

<c:set var="counter" value="0" scope="page"/>

<h2><fmt:message key = "form.addRequestReport"/></h2>	

<div class = "messages"><jsp:include page = "/messages.jsp"/></div>

<form action = "${sessionScope.alias}" method = "post" name = "taskForm">
   <table class = "form">                               
      <tr>
         <td class = "label"><fmt:message key = "request.report"/><span class="star">*</span></td>
         <td>
            <textarea name = "text" rows="10" cols="50"><c:out value = "${requestBean.leadExecutorReport}"/></textarea>
         </td>
      </tr>
</table>
     
<input name = "_action" type = "hidden" value="processRequestReportForm">   
<input name = "request_id" type = "hidden" value='<c:out value="${requestBean.id}"/>'>   


<p>
<input type="submit" value='<fmt:message key = "Command.SaveReport"/>'>
или
<a href = "${sessionScope.alias}?_action=requestDetails&request_id=${requestBean.id}">
<fmt:message key = "Command.cancel"/>
</a> 
</p>

</form>

<h2><fmt:message key = "form.TaskReports"/></h2>
  
<table class="form">
  <c:forEach var="task" items="${tasksList}">
    <c:if test="${task.executorReport != null}">
      <tr>
        <c:set var="counter" value="${counter + 1}" scope="page"/>
        <td class="label">${task.executor.lastName}&nbsp;${task.executor.firstName}</td>
        <td><c:out value = "${task.executorReport}"/></td>
      </tr>
    </c:if>
  </c:forEach>
      
  <c:if test="${counter == 0}">
    <tr><td>
      Отчетов нет
    </td></tr>
  </c:if>
</table>

<p>
<a href = "${sessionScope.alias}?_action=requestDetails&request_id=${requestBean.id}">
   <fmt:message key = "Command.cancel"/>
</a> 
</p>